load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "webview-app",
    srcs = glob(["src/*"]),
    autocargo = {"cargo_toml_config": {
        "lib": {"name": "webview-app"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-webview-app",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    edition = "2021",
    os_deps = [
        (
            "macos",
            [
                "//eden/scm/lib/third-party/webview-sys:webview-sys",
                "//eden/scm/lib/version:rust_version",
                "fbsource//third-party/rust:base64",
                "fbsource//third-party/rust:open",
                "fbsource//third-party/rust:tinyfiledialogs",
                "fbsource//third-party/rust:tracing",
            ],
        ),
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:dirs",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
    ],
)
